<?php
/**
 * Created by 绵阳人维网络科技有限公司.
 * User: 罗东华
 * Date: 2016/3/11
 * Time: 17:53
 */
namespace Admin\Controller;
use Common\Controller\LdhC;
class PublicController extends LdhC {


    public function login(){
        
        if(D('Admin')->admin_info()){
            $this->redirect('index/index');
        }
        if(IS_POST){
            $result=D('Admin','Logic')->login();
            if($result['status']==true){
                $this->redirect('index/index');
            }else{
                $this->error($result['msg']);
            }


        }

        $this->display();
    }

    public function code(){

        $verify = new \Think\Verify();
        $verify->fontSize = 22;
        $verify->length   = 4;

        return $verify->entry();
    }

}